<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>批量物流</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/style/admin.css" media="all">
	<link rel="stylesheet" href="/style/list.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
				<div class="layui-inline">
                    <!--<button type="button" class="layui-btn" id="test1">上传文件</button>-->
                    <form id="form1" method="post" action="http://127.0.0.1:8086/export/readExcel" enctype="multipart/form-data">
                        <!--action="/readExcel"-->
                        <tr>
                            <td width="25%" align="right">上传文件：</td>
                            <td><input id="file" type="file" NAME="file" style="width:300px;"></td>
                        </tr>
                        <tr align="center" valign="middle">
                            <td height="60" colspan="2"><input type="submit" ID="BtnOK" value="确认上传"></td>
                        </tr>

                    </form>
                </div>
        </div>

        <div class="layui-card-body">

            <table class="layui-hide" id="test"></table>
			
            <script type="text/html" id="barDemo">
                <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">下载</a>
            </script>

        </div>
    </div>
</div>
<script src="/layui/layui.js"></script>
<script src="/layui/jquery.min.js"></script>
<style>
    .layui-body{overflow-y: scroll;}	
	.laytable-cell-1-orderId{width:50px;}
</style>
<script type="text/javascript">
    var tip_index = 0;  
	function show(e)
	{
		tip_index = layer.tips($("#orderGoos"+e).html(), "#order"+e, {tips: [2, '#ddd'],time: 0,area: ['300px', 'auto'],});
	}
</script>
<script>
    $(function () {
        $.ajax({
            url:"/getOrderUrl",
            type:'post',
            dataType: 'json',
            contentType: 'application/json',
            success: function (result) {
                if(result.code=="000000"){
                    var url=result.data+"export/readExcel?id="+result.count;
                    // alert(url);
                    $("#form1").attr("action",url);
                }else {
                    alert("请登录")
                }
            }
        });
    });
    function Check() {

        // var phoneNumber = $.trim($("#PhoneNumber").val());
        // var isMobile=/^1?(3|5|7|8)\d{9}$/;
        // if (isMobile.test(phoneNumber) == false) {
        //     alert("电话号码格式错误");
        //     $("#PhoneNumber").focus();
        //     return false;
        // }
        // return true;
    }
    var table;
    layui.use('table', function(){
        table = layui.table
            ,form = layui.form;

        // table.render({
        //     elem: '#test'
        //     ,url:'/data/logistics/logistics.js'
		// 	,cellMinWidth:80
        //     ,cols: [[
        //         {type:'numbers'}
        //         ,{type: 'checkbox'}
        //         ,{field:'logisticsId',width:60,title:'ID'}
        //         ,{field:'orderNo', title:'订单编号'}
		// 		,{field:'logisticsNo',title:'物流编号'}
		// 		,{field:'Status',title:'状态'}
		// 		,{field:'Aid',title:'操作员'}
		// 		,{field:'AddTime',width:200,title: '上传时间',templet :function (row){return createTime(row.AddTime);}}
        //     ]]
		// 	,page: true
        //     ,id: 'testReload'
        // });

        //监听表格复选框选择
        table.on('checkbox(demo)', function(obj){
            console.log(obj)
        });


    });


    function createTime(v){
        return new Date(parseInt(v)).toLocaleString()
    }
    /**重写toLocaleString方法*/
    Date.prototype.toLocaleString = function() {
        var y = this.getFullYear();
        var m = this.getMonth()+1;
        m = m<10?'0'+m:m;
        var d = this.getDate();
        d = d<10?("0"+d):d;
        var h = this.getHours();
        h = h<10?("0"+h):h;
        var M = this.getMinutes();
        M = M<10?("0"+M):M;
        var S=this.getSeconds();
        S=S<10?("0"+S):S;
        return y+"-"+m+"-"+d+" "+h+":"+M+":"+S;}
	
</script>
<script>
layui.use('upload', function(){
  var upload = layui.upload;
   
  //执行实例
  var uploadInst = upload.render({
    elem: '#test1' //绑定元素
    ,url: '/upload/' //上传接口
    ,done: function(res){
      //上传完毕回调
    }
    ,error: function(){
      //请求异常回调
    }
  });
});
</script>

</body>
</html>